package com.yycx.module.bus.provider.controller;

import com.yycx.common.security.OpenHelper;
import com.yycx.common.springmvc.base.BaseController;
import com.yycx.module.bus.client.entity.BusOrderDetails;
import com.yycx.module.bus.provider.service.BusOrderDetailsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;


/**
 * 订单明细控制器
 *
 * @author flyme
 * @date 2020-08-19
 */
@Controller
@RequestMapping("/bus/bod/")
public class BusOrderDetailsExportController extends BaseController<BusOrderDetailsService, BusOrderDetails> {

    @PostMapping(value = "export2")
    public void export2(@RequestParam(required = false) Map params, HttpServletRequest request, HttpServletResponse response) {
        Long userId = OpenHelper.getUserId();
        params.put("exportKey", "report:" + userId);
        bizService.templateExport(params, request, response, "业务明细表", "业务明细表", "orderDetailsReportHandler");
    }

}
